app.controller("baseController",function($scope){

    /**
     * 多选
     * @type {Array}
     */
    $scope.selectedId = [];//存放 所选中的ID

    $scope.updateSelection = function($event,id){
        if($event.target.checked){
            //true
            $scope.selectedId.push(id);
        }else{
            //false
            var idIndex = $scope.selectedId.indexOf(id);
            $scope.selectedId.splice(idIndex,1);
        }
    };
    /**
     * 模糊 分页
     */
    $scope.reloadList = function(){
        $scope.search($scope.pageModel.currentPage,$scope.pageModel.itemsPerPage);
    };
    $scope.pageModel = {
        currentPage: 1,
        totalItems: 10,
        itemsPerPage: 5,
        perPageOptions: [5, 10, 15, 20, 25],
        onChange: function(){
            /*$scope.reloadList();//重新加载*/
            $scope.reloadList();
        }
    };
});